home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / delphi.swg / 0001_What CD Track am I on?.pas next >
Encoding:
Pascal/Delphi Source File  |  1995-11-22  |  465 b   |  21 lines

  1.  
  2. Here's an easy way to do it:
  3. create a timer and put this code in the OnTimer event:
  4.  
  5. var Trk, Min, Sec: Word;
  6. begin
  7. with MediaPlayer1 do
  8. begin
  9. Trk:= MCI_TMSF_TRACK(Position);
  10. Min:=MCI_TMSF_MINUTE(Position);
  11. Sec:=MCI_TMSF_SECOND(Position);
  12. Label1.Caption:=Format('%.2d',[Trk]);
  13. Label2.Caption:=Format('%.2d:%.2d',[Min,Sec]);
  14. end;
  15. end;
  16.  
  17.  
  18. Add MMSystem to the uses clause in Unit1
  19. This will show current track and time.
  20. Hope it actually works?!?!
  21.